package com.dmpp.mes;

import com.github.pagehelper.PageHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.Properties;


@SpringBootApplication(scanBasePackages = "com.dmpp.mes")
@MapperScan("com.dmpp.mes.dao")
//@ServletComponentScan
public class MesApplication {

    public static void main(String[] args) {
        SpringApplication.run(MesApplication.class, args);
        System.out.println("启动成功！！！");
        System.out.println();
    }


    @Bean
    public PageHelper pageHelper() {
        PageHelper pageHelper = new PageHelper();
        Properties properties = new Properties();
        properties.setProperty("offsetAsPageNum", "true");
        properties.setProperty("rowBoundsWithCount", "true");
        properties.setProperty("reasonable", "true");
        properties.setProperty("dialect", "sqlserver");    //配置sqlserver数据库的方言
        pageHelper.setProperties(properties);
        return pageHelper;

    }

}
